#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDateTime>
#include "QGpsParser.h"

namespace Ui {
class MainWindow;
}

class QGpsParser;
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void loadCommPorts();
    void onPositionChanged(double latitude, char nsFlag,
                        double longitude, char ewFlag,
                        float altitude,
                        const QByteArray &rawLatitude,
                        const QByteArray &rawLongitude);
    void onUtcTimeChanged(const QDateTime &utcTime);
    void onSpeedChanged(float speed, float speedKMH, float dir);
    void onBeiDouSatellites(const QList<SatelliteInfo> &sats);
    void onGPSSatellites(const QList<SatelliteInfo> &sats);

    void on_openCommPortBtn_clicked();
    void on_closeCommPortBtn_clicked();


private:
    Ui::MainWindow *ui;
    QGpsParser  *gps;
};

#endif // MAINWINDOW_H
